package com.atguigu.gulimallthird.controller;

import com.atguigu.common.utils.R;
import com.atguigu.gulimallthird.configuation.SmsAutoConfiguation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SmsController {

    @Autowired
    private SmsAutoConfiguation smsAutoConfiguation;

    @GetMapping("/sms/sendCode")
    public R sendCode(@RequestParam("code") String code,@RequestParam("phone") String phone) {
        //发送短信验证码
        smsAutoConfiguation.sms(code,phone);
        return R.ok();

    }
}
